package top.plgxs.basic.one;

import java.util.Arrays;

/**
 * <p> String类 </p>
 *
 * @author Stranger.
 * @since 2022/9/2 15:16
 */
public class StringA {
    public static void main(String[] args) {
        // replace & replaceAll
        String str = "http://www.baidu.com";
        System.out.println(str.replace(".", "@"));
        System.out.println(str.replaceAll(".","@"));
        System.out.println(str.replaceFirst(".", "@"));

        // substring: baidu
        System.out.println(str.substring(11, 16));

        // split
        String[] arr = str.split("\\.");
        System.out.println(Arrays.toString(arr));

        System.out.println(str.concat("abcd"));

    }
}
